<!DOCTYPE html>
<html>

<head>
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="zh-CN">
    <meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="关键词" />
    <meta name="description" content="页面简介" />
    <link rel="icon" href="favicon.ico" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="csaa/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="./csaa/fonts/iconfont/iconfont.css">
    <link rel="stylesheet" href="./csaa/fonts/materialicons/material-icons.css">

    <script language="javascript" type="text/javascript" src="csaa/js/jquery.min.js"></script>
    <script language="javascript" type="text/javascript" src="csaa/js/site.js"></script>
    <script src="csaa/js/httpPath.js"></script>
    <script src="csaa/js/httpUtils.js"></script>
    <title>全国青少年航空科学素质等级考试</title>
</head>

<body>
    <!-- 头部 开始 -->
    <div class="header">

    </div>
    <!-- 头部 结束 -->


    <!-- 内页banner 开始 -->
    <div class="in_banner">
        <div class="in_banner_box" style="background-image: url(./demo/img/banner01.jpg)
	"></div>
        <div class="text">考级动态</div>
    </div>
    <!-- 内页banner 开始 -->

    <!-- 主体 开始 -->
    <div id="news_main">
        <div class="main">
            <div class="news_content">
                <div class="list_news">
                </div>
                <a class="main_more">加载更多</a>
            </div>
            <div class="latest_news">
                <div class="latest_title"><i class="material-icons">&#xe05e;</i><span class="text">最新动态</span></div>
                <div class="list_latest">

                </div>
                <div class="manage_btnwrap">
                    <a class="btn btn_color_1" href="./news.html">查看更多</a>
                </div>
            </div>

            <!-- 动态模板 开始 -->
            <div id="tmp_item_news" style="display: none;">
                <div class="item">
                    <div class="item_box">
                        <a class="img_wrap">
                            <div class="img" style="background-image: url()"></div>
                        </a>
                        <a class="text_wrap">
                            <div class="title">
                                <!-- <span class="badge badge_color_1"></span> -->
                                <span class="title_text"></span>
                            </div>
                            <div class="subtitle"></div>
                            <div class="time"></div>
                        </a>
                        <div class="manage_btnwrap">
                            <!-- <a class="btn btn_color_1 btn_down" href="" target="_blank"><i class="material-icons">&#xe2c4;</i></a> -->
                            <!-- <a class="btn btn_color_2 btn_link"  href=""><span>MORE</span></a> -->
                        </div>
                    </div>
                </div>
            </div>
            <!-- 动态模板 结束 -->

        </div>
        <!-- footer 开始-->
        <div class="footer_wrap">
        </div>
        <script>
            fun_islogin(true); //页面头部登录
            var scrollload = {};
            var pauseload = {};
            //载入公告列表
            var ajax_news_list;
            $(".news_content").on("click", ".main_more", function() {
                if (pauseload.news_list) {
                    return false;
                }
                pauseload.news_list = 1;

                //暂停滚动载入新内容
                scrollload.news_list = 0;

                var $tmp_this_card_more = $(this);

                var tmp_news_page = $(this).data("page") ? $(this).data("page") : 1;

                if (tmp_news_page <= 1) {
                    if (ajax_news_list) {
                        ajax_news_list.abort();
                    }
                    $(".list_news").html("");
                }



                //console.log( tmp_params );

                httpPost(GET_NEWS_LIST, {
                    pageSize: 10,
                    pageNum: tmp_news_page,
                    sortType: 1
                }, function(results) {
                    var $tmp_html = $("<div/>");
                    var fetch_data = results;
                    //没有更多内容了
                    if (fetch_data.length == 0) {
                        $tmp_this_card_more.html("没有更多内容了").addClass("nomore");
                        pauseload.hqgoods_list = 0;
                        return false;
                    }
                    for (var i = 0; i < fetch_data.length; i++) {
                        var $tmp_item = $("#tmp_item_news .item").clone();

                        $tmp_item.find(".img").attr("data-lazybgimg", fetch_data[i].img);

                        $tmp_item.find(".badge").html(fetch_data[i].newsType ? fetch_data[i].newsType.typeName : "无分类");
                        $tmp_item.find(".title_text").html(fetch_data[i].title);
                        $tmp_item.find(".subtitle").html(fetch_data[i].summary);
                        $tmp_item.find(".time").html(toDateStr(fetch_data[i].createDate));

                        //动态链接
                        $tmp_item.find(".btn_link").attr("href", "./news_info.html?id=" + fetch_data[i].id);
                        $tmp_item.find(".img_wrap").attr("href", "./news_info.html?id=" + fetch_data[i].id);
                        $tmp_item.find(".text_wrap").attr("href", "./news_info.html?id=" + fetch_data[i].id);


                        //下载链接
                        if (!fetch_data[i].fileName) {
                            $tmp_item.find(".btn_down").hide();
                        } else {
                            $tmp_item.find(".btn_down").attr("href", DOWNLOAD_FILE + '?downloadFileName=' + encodeURI(fetch_data[i].fileName) + '&url=' + encodeURI(fetch_data[i].fileUrl));
                        }

                        $tmp_item.data("announcement_id", fetch_data[i].announcement_id);

                        $tmp_html.append($tmp_item);
                    }

                    $tmp_html.find(".item").appendTo(".list_news");

                    //允许滚动载入新内容
                    scrollload.news_list = 1;

                    //页数累加
                    tmp_news_page++;
                    $tmp_this_card_more.data("page", tmp_news_page);
                    lazy();
                    $tmp_this_card_more.html("点击载入更多");

                    pauseload.news_list = 0;
                });


            });
            $(".news_content .main_more").data("page", 1).click();

            //滚动载入新内容
            $(window).scroll(function() {
                if (scrollload.news_list) {
                    scrollLoad($(".news_content .main_more"));
                }
            });

            // 载入最新动态
            fun_news();
        </script>


        <!------------------------------------ 主体分割 -------------------------------->



    </div>
    <!-- 主体 结束 -->


</body>

</html>
